package icu.wdtt.enumModel;

public enum HttpRequestMessage {


    //2xx,为成功
     SUCCESS("请求成功",200),
     SUCCESS_ADD("添加成功",200),
    SUCCESS_UPDATE("修改成功",200),
    SUCCESS_QUERY("查询成功",200),
    SUCCESS_DELETE("删除成功",200),
    SUCCESS_GET_CODE("获取验证码成功",200),
    SUCCESS_CHECK_CODE("验证码正确!",200),
    SUCCESS_RESET("重置成功",200),
    SUCCESS_IS_USERNAME("该用户名可用",200),
    SUCCESS_REGISTER("注册成功",200),
    SUCCESS_LOGIN("登陆成功,有效期为两个小时",200),


    //4xx,为失败
    FAIL("请求失败",400),
    FAIL_ADD("添加失败",400),
    FAIL_UPDATE("修改失败",400),
    FAIL_QUERY("查询失败",400),
    FAIL_DELETE("删除失败",400),
    FAIL_GET_CODE("获取验证码失败",400),
    FAIL_CHECK_CODE("验证码错误",400),
    FAIL_IS_USERNAME("该用户名已被其他人使用",400),
    FAIL_REGISTER("注册失败",400),
    FAIL_RESET("重置失败",400),
    FAIL_LOGIN("登陆失败",400),
    FAIL_NOT_LOGIN("用户未登陆",401),
    FAIL_NO_PERMISSION("您无权限访问",402),
    FAIL_NO_ROLE("您角色权限不够",402),


    //5xx,直接错误
    INTERNAL_ERROR("内部错误",500);



     protected String  message;
     protected int statusCode;

    HttpRequestMessage() {
    }

    HttpRequestMessage(String message, int statusCode) {
        this.message = message;
        this.statusCode = statusCode;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }
}
